package oop8;

/**
 * @author oldliu
 * @since 1.0
 */
//画图程序
public class Painter {
    private String name;

    public Painter(String n) {
        this.name = n;
    }

    public void calc(Shape s) {
        double a = s.calcArea();
        double z = s.calcPerimeter();
        //对象和字符串做拼接时，系统把对象的toString的返回值和字符做拼接
        System.out.println("工具："+name+"开始绘制图像:");
        System.out.println(s);
        System.out.println("这个图像的周长是"+z+",面积是"+a);
    }
}
